﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MobileFlashLight
{
    public partial class frmSettings : Form
    {
        public frmSettings()
        {
            InitializeComponent();
        }

        private void menuItemSave_Click(object sender, EventArgs e)
        {
            int red = (int) numericUpDownRed.Value;
            int green = (int) numericUpDownGreen.Value;
            int blue = (int) numericUpDownBlue.Value;

            Global.Color = Color.FromArgb(red, green, blue);

            this.Close();
        }

        private void numericUpDown_ValueChanged(object sender, EventArgs e)
        {
            int red = (int) numericUpDownRed.Value;
            int green = (int) numericUpDownGreen.Value;
            int blue = (int) numericUpDownBlue.Value;

            panel.BackColor = Color.FromArgb(red, green, blue);
        }

        private void frmSettings_Load(object sender, EventArgs e)
        {
            numericUpDownRed.Value = (int) Global.Color.R;
            numericUpDownGreen.Value = (int) Global.Color.G;
            numericUpDownBlue.Value = (int) Global.Color.B;
        }
    }
}